import { post } from '@/api/http';
import { defineStore } from 'pinia'

export const useClothColorAttributeStore = defineStore('clothColorAttribute', {
    state: () => {
        return {
            total: 0,
            page: 1,
            size: 10,
            pageData: {
                showAdd: false,
                sideTitle: "新增坯布颜色属性",
                dropDownData: "",
                pageLoading: false,
                rHeight: "",
                btnList: [],
                isEdit: false
            } as any,
            table:{
                dataList:[]
            }as any,
            selectedRowKeys:[] as any,
            rowKey:'id',
            tableColumns:[
                {
                    title: "序号",
                    key: "serialNo",
                    dataIndex: "serialNo",
                    width: 150
                },
                {
                    title: "颜色属性",
                    key: "colorattribute",
                    dataIndex: "colorattribute",
                    width: 150
                },
                {
                    title: "备注",
                    key: "remark",
                    dataIndex: "remark",
                    width: 150
                },
                {
                    title: "创建人",
                    key: "createName",
                    dataIndex: "createName",
                    width: 150
                },
                {
                    title: "创建时间",
                    key: "createTime",
                    dataIndex: "createTime",
                    width: 200
                },
                {
                    title: "最后修改人",
                    key: "updateName",
                    dataIndex: "updateName",
                    width: 150
                },
                {
                    title: "最后修改时间",
                    key: "updateTime",
                    dataIndex: "updateTime",
                    width: 200
                },
                {
                    title: "操作",
                    key: "id",
                    dataIndex: "id",
                    slotName: "action",
                    width: 150, fixed: 'right'
                },
            ] as any
        };
    },
    actions: {
        selectBd(){
            return post({
                url: "product/greyColorattribute/selectPage",
                data: {
                    page: this.page,
                    size: this.size,
                    deleteState: 0,
                }
            })
        },
      },
})